﻿using ParamsDict = System.Collections.Generic.IDictionary<string, string>;

namespace QuickTuner.RadioProtocol.Modules
{
    public class RadioModule : ProtocolModuleBase
    {
        public override string Name { get { return "RADIO"; } }

        public RadioModule() { }

        public RadioModule(IRadio target) : base(target) { }

        // methods ______________________________________________________________________

        protected override void OnInitActions()
        {
            CanExecuteDelegate alwaysCan = x => true;

            RegisterAction("PLAY", alwaysCan, Play);
            RegisterAction("STOP", alwaysCan, Stop);
        }

        public void Play(ParamsDict parameters)
        {
            Target.Play();
        }

        public void Stop(ParamsDict parameters)
        {
            Target.Stop();
        }
    }
}